<template>
  <div id="app">
    <navigation>
      <router-view/>
    </navigation>
  </div>
</template>

<script>
  export default {
    watch: {
      '$route': (to, from) => {
        document.title = to.meta.title || ' '
        let u = navigator.userAgent;
        let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
        if (isIOS) {
          setTimeout(() => {
            setWebTitle(to.meta.title || ' ')
          }, 300)
        } else {
          setWebTitle(to.meta.title || ' ')
        }
        try {
          // 路由更新 取消监听的 ios手势事件 默认为允许滚动
          document.body.removeEventListener('touchmove', addEventListenerTouchmove)
        } catch (e) {
        }
      }
    }
  }
</script>

<style lang="scss">
  @import "assets/scss/global";

  #app {
    font-family: PingFangSC-Medium, 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: $theme-black;
    height: 100%;
  }
</style>
